package c.e.a.b.e.c;

import java.util.Objects;
import org.checkerframework.checker.nullness.compatqual.NullableDecl;

/* compiled from: com.google.android.gms:play-services-measurement-impl@@18.0.0 */
public final class c3<T> implements z2<T> {
    public volatile z2<T> a;
    public volatile boolean b;
    @NullableDecl
    public T c;

    public c3(z2<T> z2Var) {
        Objects.requireNonNull(z2Var);
        this.a = z2Var;
    }

    public final T q() {
        if (!this.b) {
            synchronized (this) {
                if (!this.b) {
                    Object q = this.a.q();
                    this.c = q;
                    this.b = true;
                    this.a = null;
                    return q;
                }
            }
        }
        return this.c;
    }

    public final String toString() {
        String valueOf;
        StringBuilder stringBuilder;
        Object obj = this.a;
        if (obj == null) {
            valueOf = String.valueOf(this.c);
            stringBuilder = new StringBuilder(valueOf.length() + 25);
            stringBuilder.append("<supplier that returned ");
            stringBuilder.append(valueOf);
            stringBuilder.append(">");
            obj = stringBuilder.toString();
        }
        valueOf = String.valueOf(obj);
        stringBuilder = new StringBuilder(valueOf.length() + 19);
        stringBuilder.append("Suppliers.memoize(");
        stringBuilder.append(valueOf);
        stringBuilder.append(")");
        return stringBuilder.toString();
    }
}
